/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:45 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class XeploaichungchiEntity
    {
        public XeploaichungchiEntity()
        {
			m_fk_ichungchiid=0;
			m_isothutu=0;
			m_isodiem=0;
			m_stenxeploai="";
        }
		private Int16 m_fk_ichungchiid;
		public Int16 FK_iChungchiID
		{
			get { return m_fk_ichungchiid ; }
			set { m_fk_ichungchiid = value; }
		}
		private Int16 m_isothutu;
		public Int16 iSothutu
		{
			get { return m_isothutu ; }
			set { m_isothutu = value; }
		}
		private Int16 m_isodiem;
		public Int16 iSodiem
		{
			get { return m_isodiem ; }
			set { m_isodiem = value; }
		}
		private String m_stenxeploai;
		public String sTenxeploai
		{
			get { return m_stenxeploai ; }
			set { m_stenxeploai = value; }
		}

        #region Comparison
        public static List<XeploaichungchiEntity> Sort(List<XeploaichungchiEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(XeploaichungchiEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<XeploaichungchiEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<XeploaichungchiEntity> COMPARISON_FK_iChungchiID
		{
			get
			{
				return delegate(XeploaichungchiEntity entity,XeploaichungchiEntity other)
				{
					return entity.FK_iChungchiID.CompareTo(other.FK_iChungchiID);
				};
			}
		}
		public static Comparison<XeploaichungchiEntity> COMPARISON_iSothutu
		{
			get
			{
				return delegate(XeploaichungchiEntity entity,XeploaichungchiEntity other)
				{
					return entity.iSothutu.CompareTo(other.iSothutu);
				};
			}
		}
		public static Comparison<XeploaichungchiEntity> COMPARISON_iSodiem
		{
			get
			{
				return delegate(XeploaichungchiEntity entity,XeploaichungchiEntity other)
				{
					return entity.iSodiem.CompareTo(other.iSodiem);
				};
			}
		}
		public static Comparison<XeploaichungchiEntity> COMPARISON_sTenxeploai
		{
			get
			{
				return delegate(XeploaichungchiEntity entity,XeploaichungchiEntity other)
				{
					return entity.sTenxeploai.CompareTo(other.sTenxeploai);
				};
			}
		}
        #endregion
    }
}
